package com.blue.rpc.core.annotation;

public class ServiceConfig
{
	private String service;
	private String method;

	public ServiceConfig()
	{
	}

	public ServiceConfig(String service, String method)
	{
		this.service = service;
		this.method = method;
	}

	public String getService()
	{
		return service;
	}

	public void setService(String service)
	{
		this.service = service;
	}

	public String getMethod()
	{
		return method;
	}

	public void setMethod(String method)
	{
		this.method = method;
	}

	@Override
	public int hashCode()
	{
		final int prime = 31;
		int result = 1;
		result = prime * result + ((method == null) ? 0 : method.hashCode());
		result = prime * result + ((service == null) ? 0 : service.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj)
	{
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ServiceConfig other = (ServiceConfig)obj;
		if (method == null)
		{
			if (other.method != null)
				return false;
		}
		else if (!method.equals(other.method))
			return false;
		if (service == null)
		{
			if (other.service != null)
				return false;
		}
		else if (!service.equals(other.service))
			return false;
		return true;
	}

	@Override
	public String toString()
	{
		return String.format("[service=%s, method=%s]", service, method);
	}

}
